﻿@model BrnShop.Web.Mobile.Models.CartModel
@{
    Layout = null;
}
<!doctype html>
<html>
<head>
    <meta charset="utf-8">
    <title>我的购物车-@{@WorkContext.ShopConfig.SiteTitle}触屏版</title>
    @Html.Raw(WorkContext.ShopConfig.SEOKeyword)
    @Html.Raw(WorkContext.ShopConfig.SEODescription)
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link href="@{@WorkContext.CSSCDN}/mobile/themes/default/css/base.css" rel="stylesheet" type="text/css">
    <link href="@{@WorkContext.CSSCDN}/mobile/themes/default/css/buy.css" rel="stylesheet" type="text/css">
    <script src="@{@WorkContext.ScriptCDN}/mobile/scripts/utils.js" type="text/javascript"></script>
    <script src="@{@WorkContext.ScriptCDN}/mobile/scripts/common.js" type="text/javascript"></script>
    <script src="@{@WorkContext.ScriptCDN}/mobile/scripts/cart.js" type="text/javascript"></script>
    <script type="text/javascript">
        uid = @WorkContext.Uid;
        isGuestSC = @WorkContext.ShopConfig.IsGuestSC;
    </script>
</head>

<body>
<header>
  <div class="new-header">
    <a href="javascript:pageBack()" class="new-a-back"><span>返回</span></a>
    <h2>我的购物车</h2>
    <a href="javascript:navSH()" class="new-a-brn"><span>BRN键</span></a> 
  </div>
  <div class="new-brn-tab" id="nav" style=" display:none;">
    <div class="new-tbl-type"> 
    <a href="@Url.Action("index", "home")" class="new-tbl-cell"><span class="icon">首页</span><p style="color:#6e6e6e;">首页</p></a> 
    <a href="@Url.Action("list", "category")" class="new-tbl-cell"><span class="icon2 on">分类搜索</span><p style="color:#6e6e6e;" class="on">分类搜索</p></a> 
    <a href="@Url.Action("index", "cart")" class="new-tbl-cell"><span class="icon3">购物车</span><p style="color:#6e6e6e;">购物车</p></a> 
    <a href="@Url.Action("index", "ucenter")" class="new-tbl-cell"><span class="icon4 on">个人中心</span><p style="color:#6e6e6e;" class="on">个人中心</p></a> 
    </div>
  </div>
</header>

<div id="cartBody">
@if (Model != null && Model.CartItemList.Count > 0)
{
    <div class="cartItme">
        @foreach (CartItemInfo cartItemInfo in Model.CartItemList)
        {
            if (cartItemInfo.Type == 0)
            {
                CartProductInfo cartProductInfo = (CartProductInfo)cartItemInfo.Item;
                <div class="proInfo">
                    <div class="price">￥@cartProductInfo.OrderProductInfo.DiscountPrice</div>
                    <a class="del" href="javascript:void(0)" onclick="if (confirm('您确定要把该商品移出购物车吗？')) delCartProduct(@cartProductInfo.OrderProductInfo.Pid,0)"></a>
                    <div class="proInfo1"><input type="checkbox" class="checkbox" name="cartItemCheckbox" @{if (cartProductInfo.Selected)
                                                                                                            {<text>checked="checked"</text>}} value="0_@{@cartProductInfo.OrderProductInfo.Pid}" onclick="cancelOrSelectCartItem()"/></div>
                    <div class="proInfo2">
                        <a href="@Url.Action("product", "catalog", new RouteValueDictionary { { "pid", cartProductInfo.OrderProductInfo.Pid } })" class="proImg"><img src="@{@WorkContext.ImageCDN}/upload/product/show/thumb60_60/@cartProductInfo.OrderProductInfo.ShowImg" width="59" height="59" /></a>
                        <div class="text">
                            <a href="@Url.Action("product", "catalog", new RouteValueDictionary { { "pid", cartProductInfo.OrderProductInfo.Pid } })">@cartProductInfo.OrderProductInfo.Name</a>
                            <div class="nb">
                                <span class="gayBt" onclick="changePruductCount(@cartProductInfo.OrderProductInfo.Pid,@Html.Raw((cartProductInfo.OrderProductInfo.BuyCount - 1).ToString()))">-</span>
                                <span class="gayBt"><input value="@cartProductInfo.OrderProductInfo.RealCount" onfocus="productNumberFocus(this)" onblur="productNumberBlur(this,@cartProductInfo.OrderProductInfo.Pid,0)"/></span>
                                <span class="gayBt" onclick="changePruductCount(@cartProductInfo.OrderProductInfo.Pid,@Html.Raw((cartProductInfo.OrderProductInfo.BuyCount + 1).ToString()))">+</span>
                            </div>
                        </div>
                    </div>
                    @if (cartProductInfo.GiftList.Count > 0)
                    {
                    <div class="ZP">
                        @foreach (OrderProductInfo gift in cartProductInfo.GiftList)
                        {
                            <a href="@Url.Action("product", "catalog", new RouteValueDictionary { { "pid", gift.Pid } })">[赠品] @gift.Name</a>
                        }
                    </div>
                    }
                </div>
            }
            else if (cartItemInfo.Type == 1)
            {
                CartSuitInfo cartSuitInfo = (CartSuitInfo)cartItemInfo.Item;
                <div class="preInfo1">
                    <input type="checkbox" class="checkbox" name="cartItemCheckbox" @{if (cartSuitInfo.Checked){<text>checked="checked"</text>}} value="1_@{@cartSuitInfo.PmId}" onclick="cancelOrSelectCartItem()"/>
                    <a class="redBt" href="javascript:;">套装</a>
                    <div class="nb">
                        <span class="gayBt" onclick="changeSuitCount(@cartSuitInfo.PmId,@Html.Raw((cartSuitInfo.BuyCount - 1).ToString()))">-</span>
                        <span class="gayBt"><input onfocus="numberFocus(this)" onblur="numberBlur(this,@cartSuitInfo.PmId,1)" value="@cartSuitInfo.BuyCount" /></span>
                        <span class="gayBt" onclick="changeSuitCount(@cartSuitInfo.PmId,@Html.Raw((cartSuitInfo.BuyCount + 1).ToString()))">+</span>
                    </div>
                    <a class="del" href="javascript:void(0)" onclick="if (confirm('您确定要把该套装移出购物车吗？')) delCartSuit(@cartSuitInfo.PmId)"></a>
                </div>
                foreach (CartProductInfo cartProductInfo in cartSuitInfo.CartProductList)
                {
                    <div class="proInfo">
                    <div class="price">￥@cartProductInfo.OrderProductInfo.DiscountPrice</div>
                    <div class="proInfo1"></div>
                    <div class="proInfo2">
                        <a href="@Url.Action("product", "catalog", new RouteValueDictionary { { "pid", cartProductInfo.OrderProductInfo.Pid } })" class="proImg"><img src="@{@WorkContext.ImageCDN}/upload/product/show/thumb60_60/@cartProductInfo.OrderProductInfo.ShowImg" width="59" height="59" /></a>
                        <div class="text">
                            <a href="@Url.Action("product", "catalog", new RouteValueDictionary { { "pid", cartProductInfo.OrderProductInfo.Pid } })">@cartProductInfo.OrderProductInfo.Name</a>
                            <div class="nb">x @cartProductInfo.OrderProductInfo.RealCount</div>
                        </div>
                    </div>
                    @if (cartProductInfo.GiftList.Count > 0)
                    {
                    <div class="ZP">
                        @foreach (OrderProductInfo gift in cartProductInfo.GiftList)
                        {
                            <a href="@Url.Action("product", "catalog", new RouteValueDictionary { { "pid", gift.Pid } })">[赠品] @gift.Name</a>
                        }
                    </div>
                    }
                </div>
                }
            }
            else if (cartItemInfo.Type == 2)
            {
                CartFullSendInfo cartFullSendInfo = (CartFullSendInfo)cartItemInfo.Item;
                if (cartFullSendInfo.FullSendMinorOrderProductInfo != null)
                {
                    <div class="preInfo"><a class="redBt" href="javascript:;">满赠</a> 活动商品已购满 @cartFullSendInfo.FullSendPromotionInfo.LimitMoney 元,您已经换购了商品 <a href="javascript:getFullSend(@cartFullSendInfo.FullSendPromotionInfo.PmId)" class="gayBt">重新换购</a></div>
                    <div class="proInfo">
                        <div class="price">￥@cartFullSendInfo.FullSendMinorOrderProductInfo.DiscountPrice</div>
                        <a class="del" href="javascript:void(0)" onclick="if (confirm('您确定要把该商品移出购物车吗？')) delCartFullSend(@cartFullSendInfo.FullSendPromotionInfo.PmId)"></a>
                        <div class="proInfo2 change">
                            <a href="@Url.Action("product", "catalog", new RouteValueDictionary { { "pid", cartFullSendInfo.FullSendMinorOrderProductInfo.Pid } })" class="proImg"><img src="@{@WorkContext.ImageCDN}/upload/product/show/thumb60_60/@cartFullSendInfo.FullSendMinorOrderProductInfo.ShowImg" width="59" height="59" /></a>
                            <div class="text">
                            <a href="@Url.Action("product", "catalog", new RouteValueDictionary { { "pid", cartFullSendInfo.FullSendMinorOrderProductInfo.Pid } })">@cartFullSendInfo.FullSendMinorOrderProductInfo.Name</a>
                            <div class="nb">x1</div>
                            </div>
                        </div>
                    </div>
                }
                else if (cartFullSendInfo.FullSendPromotionInfo != null)
                {
                    <div class="preInfo"><a class="redBt" href="javascript:;">满赠</a> 活动商品已购满 @cartFullSendInfo.FullSendPromotionInfo.LimitMoney 元， 您只需再加价 @cartFullSendInfo.FullSendPromotionInfo.AddMoney 元， 即可 <a href="javascript:getFullSend(@cartFullSendInfo.FullSendPromotionInfo.PmId)" class="gayBt">换购商品</a></div>
                }
                foreach (CartProductInfo cartProductInfo in cartFullSendInfo.FullSendMainCartProductList)
                {
                    <div class="proInfo">
                    <div class="price">￥@cartProductInfo.OrderProductInfo.DiscountPrice</div>
                    <a class="del" href="javascript:void(0)" onclick="if (confirm('您确定要把该商品移出购物车吗？')) delCartProduct(@cartProductInfo.OrderProductInfo.Pid,0)"></a>
                    <div class="proInfo1"><input type="checkbox" class="checkbox" name="cartItemCheckbox" @{if (cartProductInfo.Selected)
                                                                                                            {<text>checked="checked"</text>}} value="0_@{@cartProductInfo.OrderProductInfo.Pid}" onclick="cancelOrSelectCartItem()"/></div>
                    <div class="proInfo2">
                        <a href="@Url.Action("product", "catalog", new RouteValueDictionary { { "pid", cartProductInfo.OrderProductInfo.Pid } })" class="proImg"><img src="@{@WorkContext.ImageCDN}/upload/product/show/thumb60_60/@cartProductInfo.OrderProductInfo.ShowImg" width="59" height="59" /></a>
                        <div class="text">
                            <a href="@Url.Action("product", "catalog", new RouteValueDictionary { { "pid", cartProductInfo.OrderProductInfo.Pid } })">@cartProductInfo.OrderProductInfo.Name</a>
                            <div class="nb">
                                <span class="gayBt" onclick="changePruductCount(@cartProductInfo.OrderProductInfo.Pid,@Html.Raw((cartProductInfo.OrderProductInfo.BuyCount - 1).ToString()))">-</span>
                                <span class="gayBt"><input value="@cartProductInfo.OrderProductInfo.RealCount" onfocus="productNumberFocus(this)" onblur="productNumberBlur(this,@cartProductInfo.OrderProductInfo.Pid,0)"/></span>
                                <span class="gayBt" onclick="changePruductCount(@cartProductInfo.OrderProductInfo.Pid,@Html.Raw((cartProductInfo.OrderProductInfo.BuyCount + 1).ToString()))">+</span>
                            </div>
                        </div>
                    </div>
                    @if (cartProductInfo.GiftList.Count > 0)
                    {
                    <div class="ZP">
                        @foreach (OrderProductInfo gift in cartProductInfo.GiftList)
                        {
                            <a href="@Url.Action("product", "catalog", new RouteValueDictionary { { "pid", gift.Pid } })">[赠品] @gift.Name</a>
                        }
                    </div>
                    }
                </div>
                }
            }
            else if (cartItemInfo.Type == 3)
            {
                CartFullCutInfo cartFullCutInfo = (CartFullCutInfo)cartItemInfo.Item;
                if (cartFullCutInfo.IsEnough)
                {
                    <div class="preInfo"><a class="redBt" href="javascript:;">满减</a> 活动商品已购满 @cartFullCutInfo.LimitMoney 元，优惠 @cartFullCutInfo.CutMoney 元</div>
                }
                else
                {
                    <div class="preInfo"><a class="redBt" href="javascript:;">满减</a> 活动商品购满 @cartFullCutInfo.LimitMoney 元，即可享受满减 @cartFullCutInfo.CutMoney 元</div>
                }
                foreach (CartProductInfo cartProductInfo in cartFullCutInfo.FullCutCartProductList)
                {
                    <div class="proInfo">
                    <div class="price">￥@cartProductInfo.OrderProductInfo.DiscountPrice</div>
                    <a class="del" href="javascript:void(0)" onclick="if (confirm('您确定要把该商品移出购物车吗？')) delCartProduct(@cartProductInfo.OrderProductInfo.Pid,0)"></a>
                    <div class="proInfo1"><input type="checkbox" class="checkbox" name="cartItemCheckbox" @{if (cartProductInfo.Selected)
                                                                                                            {<text>checked="checked"</text>}} value="0_@{@cartProductInfo.OrderProductInfo.Pid}" onclick="cancelOrSelectCartItem()"/></div>
                    <div class="proInfo2">
                        <a href="@Url.Action("product", "catalog", new RouteValueDictionary { { "pid", cartProductInfo.OrderProductInfo.Pid } })" class="proImg"><img src="@{@WorkContext.ImageCDN}/upload/product/show/thumb60_60/@cartProductInfo.OrderProductInfo.ShowImg" width="59" height="59" /></a>
                        <div class="text">
                            <a href="@Url.Action("product", "catalog", new RouteValueDictionary { { "pid", cartProductInfo.OrderProductInfo.Pid } })">@cartProductInfo.OrderProductInfo.Name</a>
                            <div class="nb">
                                <span class="gayBt" onclick="changePruductCount(@cartProductInfo.OrderProductInfo.Pid,@Html.Raw((cartProductInfo.OrderProductInfo.BuyCount - 1).ToString()))">-</span>
                                <span class="gayBt"><input value="@cartProductInfo.OrderProductInfo.RealCount" onfocus="productNumberFocus(this)" onblur="productNumberBlur(this,@cartProductInfo.OrderProductInfo.Pid,0)"/></span>
                                <span class="gayBt" onclick="changePruductCount(@cartProductInfo.OrderProductInfo.Pid,@Html.Raw((cartProductInfo.OrderProductInfo.BuyCount + 1).ToString()))">+</span>
                            </div>
                        </div>
                    </div>
                    @if (cartProductInfo.GiftList.Count > 0)
                    {
                    <div class="ZP">
                        @foreach (OrderProductInfo gift in cartProductInfo.GiftList)
                        {
                            <a href="@Url.Action("product", "catalog", new RouteValueDictionary { { "pid", gift.Pid } })">[赠品] @gift.Name</a>
                        }
                    </div>
                    }
                </div>
                }
            }
        }
    </div>
<div class="goToPay">
<div class="allSelect left"><input class="checkbox" type="checkbox" checked="checked" id="selectAllBut_bottom" onclick="cancelOrSelectAllCartItem(this)"/></div>
<p style="color: #e4393c; font-size:14px; margin:5px 0 0 10px;">总计:￥<span id="orderAmount">@Model.OrderAmount</span></p>
<p style="color: #999; font-size:12px; margin-left:10px;">商品总额:￥<span id="productAmount">@Model.ProductAmount</span> 返现:￥<span id="fullCut">@Model.FullCut</span></p>
<form action="@Url.Action("confirmorder", "order")" method="post"><input name="selectedCartItemKeyList" id="selectedCartItemKeyList" value="" type="hidden" /><a href="javascript:void(0)" onclick="goConfirmOrder()">结算</a></form>
</div>
}
else
{ 
<div class="empty-sign" style="background: url(@{@WorkContext.ImageCDN}/mobile/images/cartNull.png) no-repeat center center;background-size: 100px 100px;height: 110px;margin-top: 33px;"></div>
<div style="line-height:2em; text-align:center;">购物车空空如也，快去购物吧</div>
<div style=" padding:15px 0;text-align:center;"><a href="@Url.Action("index", "home")" class="redBt" style="text-decoration:none; font-size:16px; padding:5px 35px;">去逛逛</a></div>
}
</div>

<div id="fullSendBlock" class="HGbox" style=" display:none;">
<div class="HGtitle">
<div class="left">请选择商品</div>
<div class="right"><a href="javascript:closeFullSendBlock()" class="redBt">取消</a></div>
<div class="right" style=" margin:0px 10px 0px 0px;"><a href="javascript:addFullSend()" class="redBt">确定</a></div>
<div class="clear"></div>
</div>
<div id="fullSendProductList"></div>
</div>
<div id="fullSendMask" class="bg" style="display:none;position:absolute;left:0px;top:0px;background-color:#000;filter:alpha(opacity=90);opacity: 0.9;width:100%;height:100%;z-index:8888;"></div>

<div class="viewport">
  <footer>
    <div class="footerTop">
      @if (WorkContext.Uid < 1)
      {
      <div class="left"><a href="@Url.Action("login", "account", new RouteValueDictionary { { "returnUrl", WorkContext.Url } })">登录</a> | <a href="@Url.Action("register", "account")">注册</a></div>
      }
      else
      {
        <div class="left"><a href="@Url.Action("index", "ucenter")">@WorkContext.NickName</a> | <a href="@Url.Action("logout", "account")">退出</a></div>   
      }
      <div class="right"><a href="#top">回到顶部 </a></div>
      <div class="clear"></div>
    </div>
    <div class="footerCon"><a href="@Url.Action("index", "home")" class="hot">触屏版</a><a href="/">电脑版</a></div>
    <div class="copyright" align="center">www.brnshop.com </div>
  </footer>
</div>
<script type="text/javascript">
    //高度需要计算 .bg的高度 = 当前body的高度
    document.getElementById("fullSendMask").style.height = document.body.scrollHeight + "px";
</script>
@Html.Raw(WorkContext.ShopConfig.Script)
</body>
</html>
